From: Bilal Elmoussaoui Date: Tue, 4 Nov 2025 13:08:38 +0000 (+0100) Subject: Adapt to dropped X11 backend X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~115 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=71b19fa4222463c9a28fcb6659570a8d0f6e040c;p=gnome-shell.git Adapt to dropped X11 backend Part-of: --- diff --git a/config.h.meson b/config.h.meson index a357e1c1f..b0be35d25 100644 --- a/config.h.meson +++ b/config.h.meson @@ -40,8 +40,5 @@ /* Define to 1 if the and header file exist. */ #mesondefine HAVE_EXE_INTROSPECTION -/* Whether GNOME Shell is built with X11 support */ -#mesondefine HAVE_X11 - -/* Whether GNOME Shell is built with X11 clients support */ -#mesondefine HAVE_X11_CLIENT +/* Whether GNOME Shell is built with XWayland support */ +#mesondefine HAVE_XWAYLAND diff --git a/data/meson.build b/data/meson.build index cc7b5e2a1..0378910b2 100644 --- a/data/meson.build +++ b/data/meson.build @@ -115,15 +115,6 @@ if have_systemd unitconf = configuration_data() unitconf.set('bindir', bindir) supported_sessions = ['wayland'] - if have_x11 - configure_file( - input: 'org.gnome.Shell@x11.service.in', - output: 'org.gnome.Shell@x11.service', - configuration: unitconf, - install_dir: systemduserunitdir - ) - supported_sessions += ['x11'] - endif configure_file( input: 'org.gnome.Shell@wayland.service.in', diff --git a/data/org.gnome.Shell@x11.service.in b/data/org.gnome.Shell@x11.service.in deleted file mode 100644 index 63a014f14..000000000 --- a/data/org.gnome.Shell@x11.service.in +++ /dev/null @@ -1,39 +0,0 @@ -[Unit] -Description=GNOME Shell on X11 -# On X11, try to show the GNOME Session Failed screen -OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-failed.target -OnFailureJobMode=replace -CollectMode=inactive-or-failed -RefuseManualStart=on -RefuseManualStop=on - -After=gnome-session-manager.target - -Requisite=gnome-session-initialized.target -PartOf=gnome-session-initialized.target -Before=gnome-session-initialized.target - -ConditionEnvironment=XDG_SESSION_TYPE=%I - -# Limit startup frequency more than the default -StartLimitIntervalSec=15s -StartLimitBurst=3 - -[Service] -Slice=session.slice -Type=notify -ExecStart=@bindir@/gnome-shell -# Exit code 1 means we are probably *not* dealing with an extension failure -SuccessExitStatus=1 - -# On X11 we do not need to unset any variables - -# On X11 we want to restart on-success (Alt+F2 + r) and on-failure. -Restart=always -# Do not wait before restarting the shell -RestartSec=0ms -# Kill any stubborn child processes after this long -TimeoutStopSec=5 - -# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early -OOMScoreAdjust=-1000 diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js index 3635fd30e..0bd282b80 100644 --- a/js/misc/ibusManager.js +++ b/js/misc/ibusManager.js @@ -1,7 +1,6 @@ import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import IBus from 'gi://IBus'; -import Meta from 'gi://Meta'; import Shell from 'gi://Shell'; import * as Signals from './signals.js'; @@ -98,7 +97,7 @@ class IBusManager extends Signals.EventEmitter { async _queueSpawn() { const isSystemdService = await this._ibusSystemdServiceExists(); if (!isSystemdService) - this._spawn(Meta.is_wayland_compositor() ? [] : ['--xim']); + this._spawn([]); } _tryAppendEnv(env, varname) { diff --git a/js/ui/closeDialog.js b/js/ui/closeDialog.js index 7e48a3fae..85a391ee2 100644 --- a/js/ui/closeDialog.js +++ b/js/ui/closeDialog.js @@ -6,7 +6,6 @@ import Shell from 'gi://Shell'; import St from 'gi://St'; import * as Dialog from './dialog.js'; -import * as Main from './main.js'; const FROZEN_WINDOW_BRIGHTNESS = -0.3; const DIALOG_TRANSITION_TIME = 150; @@ -22,7 +21,6 @@ export const CloseDialog = GObject.registerClass({ super._init(); this._window = window; this._dialog = null; - this._tracked = undefined; this._timeoutId = 0; } @@ -111,38 +109,6 @@ export const CloseDialog = GObject.registerClass({ this.response(Meta.CloseDialogResponse.FORCE_CLOSE); } - _onFocusChanged() { - if (Meta.is_wayland_compositor()) - return; - - const focusWindow = global.display.focus_window; - const keyFocus = global.stage.key_focus; - - let shouldTrack; - if (focusWindow != null) - shouldTrack = focusWindow === this._window; - else - shouldTrack = keyFocus && this._dialog.contains(keyFocus); - - if (this._tracked === shouldTrack) - return; - - if (shouldTrack) { - Main.layoutManager.trackChrome(this._dialog, - {affectsInputRegion: true}); - } else { - Main.layoutManager.untrackChrome(this._dialog); - } - - // The buttons are broken when they aren't added to the input region, - // so disable them properly in that case - this._dialog.buttonLayout.get_children().forEach(b => { - b.reactive = shouldTrack; - }); - - this._tracked = shouldTrack; - } - vfunc_show() { if (this._dialog != null) return; @@ -155,12 +121,6 @@ export const CloseDialog = GObject.registerClass({ return GLib.SOURCE_CONTINUE; }); - global.display.connectObject( - 'notify::focus-window', this._onFocusChanged.bind(this), this); - - global.stage.connectObject( - 'notify::key-focus', this._onFocusChanged.bind(this), this); - this._addWindowEffect(); this._initDialog(); @@ -176,7 +136,6 @@ export const CloseDialog = GObject.registerClass({ scale_y: 1, mode: Clutter.AnimationMode.EASE_OUT_BACK, duration: DIALOG_TRANSITION_TIME, - onComplete: this._onFocusChanged.bind(this), }); } diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 06f925133..a228db696 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -398,16 +398,6 @@ const Key = GObject.registerClass({ return Clutter.EVENT_STOP; }); button.connect('touch-event', (actor, event) => { - // We only handle touch events here on wayland. On X11 - // we do get emulated pointer events, which already works - // for single-touch cases. Besides, the X11 passive touch grab - // set up by Mutter will make us see first the touch events - // and later the pointer events, so it will look like two - // unrelated series of events, we want to avoid double handling - // in these cases. - if (!Meta.is_wayland_compositor()) - return Clutter.EVENT_PROPAGATE; - const slot = event.get_event_sequence().get_slot(); if (!this._touchPressSlot && @@ -1215,16 +1205,6 @@ export const Keyboard = GObject.registerClass({ this._windowMovedId = this._focusTracker.connect('window-moved', this._onFocusWindowMoving.bind(this)); - // Valid only for X11 - if (!Meta.is_wayland_compositor()) { - this._focusTracker.connectObject('focus-changed', (_tracker, focused) => { - if (focused) - this.open(Main.layoutManager.focusIndex); - else - this.close(); - }, this); - } - this._showIdleId = 0; this._keyboardVisible = false; @@ -1449,11 +1429,10 @@ export const Keyboard = GObject.registerClass({ return; } - const emojiVisible = Meta.is_wayland_compositor() && - (purpose === Clutter.InputContentPurpose.NORMAL || - purpose === Clutter.InputContentPurpose.ALPHA || - purpose === Clutter.InputContentPurpose.PASSWORD || - purpose === Clutter.InputContentPurpose.TERMINAL); + const emojiVisible = purpose === Clutter.InputContentPurpose.NORMAL || + purpose === Clutter.InputContentPurpose.ALPHA || + purpose === Clutter.InputContentPurpose.PASSWORD || + purpose === Clutter.InputContentPurpose.TERMINAL; keyboardModel.getLevels().forEach(currentLevel => { const levelLayout = new KeyContainer(); @@ -1816,12 +1795,6 @@ export const Keyboard = GObject.registerClass({ this._keyboardHeightNotifyId = keyboardBox.connect('notify::height', () => { this.translation_y = -this.height; }); - - // Toggle visibility so the keyboardBox can update its chrome region. - if (!Meta.is_wayland_compositor()) { - keyboardBox.hide(); - keyboardBox.show(); - } } _animateHide() { diff --git a/js/ui/layout.js b/js/ui/layout.js index 3978bbefe..fa4c5b057 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -184,7 +184,6 @@ class UiActor extends St.Widget { const defaultParams = { trackFullscreen: false, affectsStruts: false, - affectsInputRegion: true, }; export const LayoutManager = GObject.registerClass({ @@ -846,8 +845,7 @@ export const LayoutManager = GObject.registerClass({ // @actor: an actor to add to the chrome // @params: (optional) additional params // - // Adds @actor to the chrome, and (unless %affectsInputRegion in - // @params is %false) extends the input region to include it. + // Adds @actor to the chrome. // Changes in @actor's size, position, and visibility will // automatically result in appropriate changes to the input // region. @@ -1056,17 +1054,12 @@ export const LayoutManager = GObject.registerClass({ delete this._updateRegionIdle; } - const rects = [], struts = []; + const struts = []; const isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow); - const wantsInputRegion = - !this._startingUp && - !isPopupMenuVisible && - Main.modalCount === 0 && - !Meta.is_wayland_compositor(); for (let i = 0; i < this._trackedActors.length; i++) { const actorData = this._trackedActors[i]; - if (!(actorData.affectsInputRegion && wantsInputRegion) && !actorData.affectsStruts) + if (!actorData.affectsStruts) continue; let [x, y] = actorData.actor.get_transformed_position(); @@ -1076,9 +1069,6 @@ export const LayoutManager = GObject.registerClass({ w = Math.round(w); h = Math.round(h); - if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility()) - rects.push(new Mtk.Rectangle({x, y, width: w, height: h})); - let monitor = null; if (actorData.affectsStruts) monitor = this.findMonitorForActor(actorData.actor); @@ -1133,9 +1123,6 @@ export const LayoutManager = GObject.registerClass({ } } - if (wantsInputRegion) - global.set_stage_input_region(rects); - this._isPopupWindowVisible = isPopupMenuVisible; const workspaceManager = global.workspace_manager; diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 86946011c..76c3cf989 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -757,8 +757,8 @@ export const MessageTray = GObject.registerClass({ this._notificationTimeoutId = 0; this._notificationRemoved = false; - Main.layoutManager.addChrome(this, {affectsInputRegion: false}); - Main.layoutManager.trackChrome(this._bannerBin, {affectsInputRegion: true}); + Main.layoutManager.addChrome(this); + Main.layoutManager.trackChrome(this._bannerBin); global.display.connect('in-fullscreen-changed', this._updateState.bind(this)); diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 706d5a7b4..a99bd58b9 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -633,11 +633,6 @@ export class ScreenShield extends Signals.EventEmitter { animateLockScreen: animate, fadeToBlack: true, }); - // On wayland, a crash brings down the entire session, so we don't - // need to defend against being restarted unlocked - if (!Meta.is_wayland_compositor()) - global.set_runtime_state(LOCKED_STATE_STR, GLib.Variant.new('b', true)); - // We used to set isActive and emit active-changed here, // but now we do that from lockScreenShown, which means // there is a 0.3 seconds window during which the lock diff --git a/js/ui/status/remoteAccess.js b/js/ui/status/remoteAccess.js index 99d7f9483..7974a1b06 100644 --- a/js/ui/status/remoteAccess.js +++ b/js/ui/status/remoteAccess.js @@ -2,7 +2,6 @@ import Atk from 'gi://Atk'; import Clutter from 'gi://Clutter'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; -import Meta from 'gi://Meta'; import St from 'gi://St'; import * as Main from '../main.js'; @@ -169,13 +168,6 @@ export const ScreenSharingIndicator = GObject.registerClass({ } _onNewHandle(handle) { - // We can't possibly know about all types of screen sharing on X11, so - // showing these controls on X11 might give a false sense of security. - // Thus, only enable these controls when using Wayland, where we are - // in control of sharing. - if (!Meta.is_wayland_compositor()) - return; - if (handle.isRecording) return; diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 66bbe66b0..51eefd298 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -897,9 +897,6 @@ export class WindowManager { return true; }); global.display.connect('x11-display-closing', () => { - if (!Meta.is_wayland_compositor()) - return; - this._stopX11Services(null); IBusManager.getIBusManager().restartDaemon(); diff --git a/man/gnome-shell.rst b/man/gnome-shell.rst index d90ea5f6c..bd89f9f4f 100644 --- a/man/gnome-shell.rst +++ b/man/gnome-shell.rst @@ -35,46 +35,18 @@ OPTIONS Run as a full display server, rather than nested -``--nested`` - - Run as a nested compositor - ``--no-x11`` Run wayland compositor without starting Xwayland -``--x11`` - - Run with X11 backend - ``--wayland-display``\ =\ *DISPLAY* Wayland display name to use -``-d``, ``--display``\ =\ *DISPLAY* - - X display to use - ``-r``, ``--replace`` Replace the running window manager -``--sm-disable`` - - Disable connection to the session manager - -``--sm-client-id``\ =\ *ID* - - Specify session management *ID* - -``--sm-save-file``\ =\ *FILE* - - Initialize session from *FILE* - -``--sync`` - - Make X calls synchronous - ``--mode=MODE`` Use a specific mode, e.g. "gdm" for login screen diff --git a/meson.build b/meson.build index 0a07efd8a..9979e6990 100644 --- a/meson.build +++ b/meson.build @@ -88,9 +88,8 @@ gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req) pango_dep = dependency('pango', version: pango_req) have_fonts = mutter_dep.get_variable('have_fonts') == 'true' -have_x11 = mutter_dep.get_variable('have_x11') == 'true' -have_x11_client = mutter_dep.get_variable('have_x11_client') == 'true' -if have_x11_client or have_x11 +have_xwayland = mutter_dep.get_variable('have_xwayland') == 'true' +if have_xwayland x11_dep = dependency('x11') xext_dep = dependency('xext') xfixes_dep = dependency('xfixes') @@ -157,8 +156,7 @@ cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) cdata.set('HAVE_NETWORKMANAGER', have_networkmanager) cdata.set('HAVE_PIPEWIRE', have_pipewire) cdata.set('HAVE_SYSTEMD', have_systemd) -cdata.set('HAVE_X11', have_x11) -cdata.set('HAVE_X11_CLIENT', have_x11_client) +cdata.set('HAVE_XWAYLAND', have_xwayland) cdata.set('HAVE_FDWALK', cc.has_function('fdwalk')) cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo')) @@ -318,7 +316,7 @@ subdir('js') subdir('src') subdir('po') -if get_option('tests') and have_x11_client +if get_option('tests') and have_xwayland subdir('tests') endif @@ -335,8 +333,7 @@ meson.add_dist_script('build-aux/generate-stylesheets.py') meson.add_dist_script('build-aux/check-version.py', meson.project_version(), 'NEWS') summary_options = { - 'x11': have_x11, - 'x11_client': have_x11_client, + 'have_xwayland': have_xwayland, 'camera_monitor': get_option('camera_monitor'), 'networkmanager': get_option('networkmanager'), 'systemd': get_option('systemd'), diff --git a/src/main.c b/src/main.c index 99eca3e3c..7feef04b7 100644 --- a/src/main.c +++ b/src/main.c @@ -677,8 +677,7 @@ main (int argc, char **argv) shell_profiler_init (); - if (meta_context_get_compositor_type (context) == META_COMPOSITOR_TYPE_WAYLAND) - meta_context_raise_rlimit_nofile (context, NULL); + meta_context_raise_rlimit_nofile (context, NULL); if (!meta_context_start (context, &error)) { diff --git a/src/meson.build b/src/meson.build index a4ce889ea..8e45074c5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,7 +13,7 @@ introspection_common = { subdir('calendar-server') subdir('hotplug-sniffer') subdir('st') -if have_x11_client +if have_xwayland subdir('tray') endif @@ -77,7 +77,7 @@ gnome_shell_deps = [ pango_dep, ] -if have_x11_client +if have_xwayland gnome_shell_deps += x11_dep endif @@ -132,7 +132,7 @@ libshell_public_headers = [ 'shell-workspace-background.h' ] -if have_x11_client +if have_xwayland libshell_public_headers += [ 'shell-tray-icon.h', 'shell-tray-manager.h', @@ -152,7 +152,7 @@ libshell_private_headers = [ 'shell-wm-private.h' ] -if have_x11_client +if have_xwayland libshell_private_headers += [ 'shell-tray-icon-private.h', ] @@ -189,7 +189,7 @@ libshell_sources = [ 'shell-workspace-background.c' ] -if have_x11_client +if have_xwayland libshell_sources += [ 'shell-tray-icon.c', 'shell-tray-manager.c', @@ -233,7 +233,7 @@ dbus_generated += gnome.gdbus_codegen('switcheroo-control', libshell_no_gir_sources += dbus_generated libshell_link_with = [] -if have_x11_client +if have_xwayland libshell_link_with += [libtray] endif diff --git a/src/shell-global.c b/src/shell-global.c index 9a6de28e9..f4c69e0d3 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -27,7 +27,7 @@ #include #include -#ifdef HAVE_X11 +#ifdef HAVE_XWAYLAND #include #endif @@ -685,50 +685,6 @@ _shell_global_destroy_gjs_context (ShellGlobal *self) g_clear_object (&self->js_context); } -/** - * shell_global_set_stage_input_region: - * @global: the #ShellGlobal - * @rectangles: (element-type Mtk.Rectangle): a list of #MtkRectangle - * describing the input region. - * - * Sets the area of the stage that is responsive to mouse clicks when - * we don't have a modal or grab. - */ -void -shell_global_set_stage_input_region (ShellGlobal *global, - GSList *rectangles) -{ -#ifdef HAVE_X11 - MtkRectangle *rect; - XRectangle *rects; - int nrects, i; - GSList *r; - MetaDisplay *display; - MetaX11Display *x11_display; - - g_return_if_fail (SHELL_IS_GLOBAL (global)); - - if (meta_is_wayland_compositor ()) - return; - - display = global->meta_display; - x11_display = meta_display_get_x11_display (display); - nrects = g_slist_length (rectangles); - rects = g_new (XRectangle, nrects); - for (r = rectangles, i = 0; r; r = r->next, i++) - { - rect = (MtkRectangle *)r->data; - rects[i].x = rect->x; - rects[i].y = rect->y; - rects[i].width = rect->width; - rects[i].height = rect->height; - } - - meta_x11_display_set_stage_input_region (x11_display, rects, nrects); - g_free (rects); -#endif -} - /** * shell_global_get_backend: * @@ -1010,7 +966,7 @@ entry_cursor_func (StEntry *entry, use_ibeam ? META_CURSOR_TEXT : META_CURSOR_DEFAULT); } -#ifdef HAVE_X11 +#ifdef HAVE_XWAYLAND static void on_x11_display_closed (MetaDisplay *display, ShellGlobal *global) @@ -1027,7 +983,7 @@ _shell_global_set_plugin (ShellGlobal *global, MetaDisplay *display; MetaBackend *backend; MetaSettings *settings; -#ifdef HAVE_X11 +#ifdef HAVE_XWAYLAND MetaX11Display *x11_display; #endif @@ -1080,7 +1036,7 @@ _shell_global_set_plugin (ShellGlobal *global, "End of frame, possibly including swap time", ""); -#ifdef HAVE_X11 +#ifdef HAVE_XWAYLAND x11_display = meta_display_get_x11_display (display); if (x11_display && meta_x11_display_get_xdisplay (x11_display)) g_signal_connect_object (global->meta_display, "x11-display-closing", diff --git a/src/shell-global.h b/src/shell-global.h index ef0799658..4894d8b4e 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -46,9 +46,6 @@ void shell_global_set_force_animations (ShellGlobal *global, gboolean force); /* Input/event handling */ -void shell_global_set_stage_input_region (ShellGlobal *global, - GSList *rectangles); - void shell_global_get_pointer (ShellGlobal *global, int *x, int *y, diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c index fc1b2375b..d1ded8c0b 100644 --- a/src/shell-screenshot.c +++ b/src/shell-screenshot.c @@ -646,42 +646,6 @@ finish_screenshot (ShellScreenshot *screenshot, return TRUE; } -static void -on_after_paint (ClutterStage *stage, - ClutterStageView *view, - ClutterFrame *frame, - GTask *result) -{ - ShellScreenshot *screenshot = g_task_get_task_data (result); - MetaDisplay *display = shell_global_get_display (screenshot->global); - MetaCompositor *compositor = meta_display_get_compositor (display); - GTask *task; - - g_signal_handlers_disconnect_by_func (stage, on_after_paint, result); - - if (screenshot->mode == SHELL_SCREENSHOT_AREA) - { - do_grab_screenshot (screenshot, - screenshot->screenshot_area.x, - screenshot->screenshot_area.y, - screenshot->screenshot_area.width, - screenshot->screenshot_area.height, - screenshot->flags); - - task = g_task_new (screenshot, NULL, on_screenshot_written, result); - g_task_run_in_thread (task, write_screenshot_thread); - } - else - { - grab_screenshot (screenshot, screenshot->flags, result); - } - - g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0, - (MtkRectangle *) &screenshot->screenshot_area); - - meta_compositor_enable_unredirect (compositor); -} - /** * shell_screenshot_screenshot: * @screenshot: the #ShellScreenshot @@ -731,26 +695,10 @@ shell_screenshot_screenshot (ShellScreenshot *screenshot, if (include_cursor) flags |= SHELL_SCREENSHOT_FLAG_INCLUDE_CURSOR; - if (meta_is_wayland_compositor ()) - { - grab_screenshot (screenshot, flags, result); + grab_screenshot (screenshot, flags, result); - g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0, - (MtkRectangle *) &screenshot->screenshot_area); - } - else - { - MetaDisplay *display = shell_global_get_display (screenshot->global); - ClutterStage *stage = shell_global_get_stage (screenshot->global); - MetaCompositor *compositor = meta_display_get_compositor (display); - - meta_compositor_disable_unredirect (compositor); - clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - screenshot->flags = flags; - screenshot->mode = SHELL_SCREENSHOT_SCREEN; - g_signal_connect (stage, "after-paint", - G_CALLBACK (on_after_paint), result); - } + g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0, + (MtkRectangle *) &screenshot->screenshot_area); } /** @@ -780,25 +728,6 @@ shell_screenshot_screenshot_finish (ShellScreenshot *screenshot, return finish_screenshot (screenshot, result, area, error); } -static void -screenshot_stage_to_content_on_after_paint (ClutterStage *stage, - ClutterStageView *view, - ClutterFrame *frame, - GTask *result) -{ - ShellScreenshot *screenshot = g_task_get_task_data (result); - MetaDisplay *display = shell_global_get_display (screenshot->global); - MetaCompositor *compositor = meta_display_get_compositor (display); - - g_signal_handlers_disconnect_by_func (stage, - screenshot_stage_to_content_on_after_paint, - result); - - meta_compositor_enable_unredirect (compositor); - - grab_screenshot_content (screenshot, result); -} - /** * shell_screenshot_screenshot_stage_to_content: * @screenshot: the #ShellScreenshot @@ -822,22 +751,7 @@ shell_screenshot_screenshot_stage_to_content (ShellScreenshot *screenshot, g_task_set_source_tag (result, shell_screenshot_screenshot_stage_to_content); g_task_set_task_data (result, screenshot, NULL); - if (meta_is_wayland_compositor ()) - { - grab_screenshot_content (screenshot, result); - } - else - { - MetaDisplay *display = shell_global_get_display (screenshot->global); - MetaCompositor *compositor = meta_display_get_compositor (display); - ClutterStage *stage = shell_global_get_stage (screenshot->global); - - meta_compositor_disable_unredirect (compositor); - clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - g_signal_connect (stage, "after-paint", - G_CALLBACK (screenshot_stage_to_content_on_after_paint), - result); - } + grab_screenshot_content (screenshot, result); } /** @@ -950,35 +864,18 @@ shell_screenshot_screenshot_area (ShellScreenshot *screenshot, screenshot->screenshot_area.width = width; screenshot->screenshot_area.height = height; + do_grab_screenshot (screenshot, + screenshot->screenshot_area.x, + screenshot->screenshot_area.y, + screenshot->screenshot_area.width, + screenshot->screenshot_area.height, + SHELL_SCREENSHOT_FLAG_NONE); - if (meta_is_wayland_compositor ()) - { - do_grab_screenshot (screenshot, - screenshot->screenshot_area.x, - screenshot->screenshot_area.y, - screenshot->screenshot_area.width, - screenshot->screenshot_area.height, - SHELL_SCREENSHOT_FLAG_NONE); - - g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0, - (MtkRectangle *) &screenshot->screenshot_area); - - task = g_task_new (screenshot, NULL, on_screenshot_written, result); - g_task_run_in_thread (task, write_screenshot_thread); - } - else - { - MetaDisplay *display = shell_global_get_display (screenshot->global); - MetaCompositor *compositor = meta_display_get_compositor (display); - ClutterStage *stage = shell_global_get_stage (screenshot->global); - - meta_compositor_disable_unredirect (compositor); - clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - screenshot->flags = SHELL_SCREENSHOT_FLAG_NONE; - screenshot->mode = SHELL_SCREENSHOT_AREA; - g_signal_connect (stage, "after-paint", - G_CALLBACK (on_after_paint), result); - } + g_signal_emit (screenshot, signals[SCREENSHOT_TAKEN], 0, + (MtkRectangle *) &screenshot->screenshot_area); + + task = g_task_new (screenshot, NULL, on_screenshot_written, result); + g_task_run_in_thread (task, write_screenshot_thread); } /** diff --git a/src/shell-util.c b/src/shell-util.c index a965c7148..da056a015 100644 --- a/src/shell-util.c +++ b/src/shell-util.c @@ -23,7 +23,7 @@ #include #include #include -#ifdef HAVE_X11_CLIENT +#ifdef HAVE_XWAYLAND #include #endif @@ -789,7 +789,7 @@ gboolean shell_util_has_x11_display_extension (MetaDisplay *display, const char *extension) { -#ifdef HAVE_X11_CLIENT +#ifdef HAVE_XWAYLAND MetaX11Display *x11_display; Display *xdisplay; int op, event, error; diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 839f5244b..124176421 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -10,7 +10,7 @@ #include #include #include -#ifdef HAVE_X11_CLIENT +#ifdef HAVE_XWAYLAND #include #endif @@ -302,7 +302,7 @@ static ShellApp* get_app_from_window_group (ShellWindowTracker *tracker, MetaWindow *window) { -#ifdef HAVE_X11_CLIENT +#ifdef HAVE_XWAYLAND ShellApp *result; GSList *group_windows; MetaGroup *group; diff --git a/src/st/meson.build b/src/st/meson.build index 693a143f4..772ace842 100644 --- a/src/st/meson.build +++ b/src/st/meson.build @@ -213,7 +213,7 @@ libst_dep = declare_dependency( include_directories: [st_inc], ) -if get_option('tests') and have_x11_client +if get_option('tests') and have_xwayland mutter_test_dep = dependency(libmutter_test_pc, version: mutter_req) test_theme = executable('test-theme', sources: 'test-theme.c',